package com.mysiteforme.admin.mvc.system.confab.dao;

import com.baomidou.mybatisplus.plugins.Page;
import com.mysiteforme.admin.entity.vo.VoTableField;
import com.mysiteforme.admin.entity.vo.VoTable;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by wangl on 2017/12/25.
 * todo: 数据库操作表
 */
@Repository("tableDao")
public interface TableDao {

    List<VoTable> listAll(String databaseName);

    List<VoTable> listPage(Map<String,Object> map, Page<VoTable> page);

    Integer selectTableCount(String databaseName);

    Integer existTable(String tableName,String databaseName);

    Integer existTableField(Map<String,Object> map,String databaseName);

    void creatTable(Map<String,Object> map);

    void addColumn(Map<String,Object> map);

    void updateColumnSameName(Map<String,Object> map);

    void updateColumnDiffName(Map<String,Object> map);

    void dropTable(@Param("tableName") String tableName);

    void dropTableField(Map<String,Object> map);

    List<VoTableField> selectFields(Map<String,Object> map, String databaseName);

    VoTable selectDetailTable(String name, String databaseName);

    List<VoTableField> selectFields(Page<VoTableField> objectPage, Map<String,Object> map);

    void changeTableName(Map<String,Object> map);

    void changeTableComment(Map<String,Object> map);
}
